﻿@using BrnMall.Manager.Domain.Promotion
@model BrnMall.Web.StoreAdmin.Models.GroupBuyListModel

@section header{
    <title>拼团活动-促销活动</title>
    <link type="text/css" rel="stylesheet" href="/admin_store/css/site.css" />
    <script type="text/javascript" src="/admin_store/scripts/jquery.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/showlist.js"></script>
}
@section body{
    <h1 class="rightH1">
		微信小程序 &gt; 促销活动 &gt; <span class="rightH1-cur">团购活动</span>
			<div class="right">
				<a href="@Url.Action("AddOrEditGroupBuy")" class="menuBT"><img src="/admin_store/images/add.jpg" />添加</a>
				<a href="@Url.Action("EditGroupBuyProductSetting")" class="menuBT"><img src="/admin_store/images/add.jpg" />小程序设置</a>
				<div class="clear"></div>
			</div>
			<div class="clear"></div>
</h1>
    <div class="table_top"></div>

    <div class="dataList">
        <table width="100%">
            <thead>
                <tr>
                    <th width="80">编号</th>
                    <th align="left">名称</th>
                    <th align="left">团人数</th>
                    @*<th align="left">限时</th>*@
                    <th align="left">开始时间</th>
                    <th align="left">结束时间</th>
                    <th width="80" align="left">状态</th>
                    <th align="left">管理操作</th>
                </tr>
            </thead>
            <tbody>
                @foreach (GroupBuy info in Model.GroupBuyList)
                {
                    <tr>
                        <td>@info.Id</td>
                        <td>@info.Name</td>
                        <td>@info.LimitBuyerCount</td>
                        @*<td>@info.LimitHour</td>*@
                        <td>@if (info.StartTime.Year != 1900)
                            {
                                @info.StartTime.ToString("yyyy-MM-dd HH:mm:ss")
                            }
                        </td>
                        <td>
                            @if (info.EndTime.Year != 1900)
                        {
                            @info.EndTime.ToString("yyyy-MM-dd HH:mm:ss")
                        }
                    </td>

                        <td>
                            @(info.Status==0?"开启":"关闭")
                        </td>
                        
                        <td>
                            <a href="@Url.Action("GroupBuyProductList", new { groupId = info.Id })" class="editOperate">活动商品</a>&nbsp;|&nbsp;

                            @if (info.Status == 1)
                            {
                                <a href="@Url.Action("UpdateGroupBuyStatus", new {id = info.Id,status=0})" class="editOperate">开启</a>
                            }&nbsp;|&nbsp;
                            @if (info.Status == 1)
                            {
                                <a href="@Url.Action("DeleteGroupBuy", new {id = info.Id})" class="deleteOperate">删除</a>
                            }
                            else
                            {
                                <a href="@Url.Action("UpdateGroupBuyStatus", new {id = info.Id,status=1})" class="editOperate">关闭</a>
                            }
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>

    <div class="table_bottom"></div>
}